home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / win / ch09 / 09fig08.wrl < prev    next >
Text File  |  1996-09-23  |  893b  |  40 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright 1997 By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Rotating Cube
  8.         DEF Cube Transform {
  9.             children Shape {
  10.                 appearance Appearance {
  11.                     material Material { }
  12.                 }
  13.                 geometry Box { }
  14.             }
  15.         },
  16.     # Sensors
  17.         DEF Drag  PlaneSensor { },
  18.         DEF Touch TouchSensor { },
  19.     # Animation clock
  20.         DEF Clock TimeSensor {
  21.             enabled FALSE
  22.             cycleInterval 4.0
  23.             loop TRUE
  24.         },
  25.     # Animation path
  26.         DEF CubePath OrientationInterpolator {
  27.             key [ 0.0, 0.50, 1.0 ]
  28.             keyValue [
  29.                 0.0 1.0 0.0  0.0,
  30.                 0.0 1.0 0.0  3.14,
  31.                 0.0 1.0 0.0  6.28
  32.             ]
  33.         }
  34.     ]
  35. }
  36. ROUTE Touch.isOver             TO Clock.set_enabled
  37. ROUTE Clock.fraction_changed   TO CubePath.set_fraction
  38. ROUTE CubePath.value_changed   TO Cube.set_rotation
  39. ROUTE Drag.translation_changed TO Cube.set_translation
  40.